package com.bp.ice.serviceimp;

import com.bp.ice.dao.iceUserDao11;
import com.bp.ice.po.userpo;
import com.bp.ice.service.iceUserService11;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class iceUserServiceimp11 implements iceUserService11 {
    @Autowired
    private iceUserDao11 iceUserDao11;
    @Override
    public Integer check(String username, String password) {
        Integer check = iceUserDao11.findiceUserId(username, password);
         return  check;
    }
    @Override
    public Integer addUser(String username, String password) {
        int rom = (int) ((Math.random() * 9 + 1) * 10000);
        String yzm=rom+"x";
        Integer rows = iceUserDao11.addUser(username, password,yzm);
        return rows;
    }

    @Override
    public String findPassword(String mobile, String yzm,String username) {
        String password = iceUserDao11.PasswordByPhone(mobile, yzm,username);
        return password;
    }

    @Override
    public List<userpo> display(String username) {
        List<userpo> display = iceUserDao11.display(username);
        return display;
    }

    @Override
    public Integer storeUser(userpo po) {
        Integer integer = iceUserDao11.storeUser(po);
        return integer;
    }
}
